<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="Countries.aspx.cs" Inherits="Countries" Title="Project Monitoring System"
    Culture="auto:en-US" UICulture="auto" meta:resourcekey="PageResource1" %>

<%@ Register Src="Buttons.ascx" TagName="Buttons" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"
    Visible="false">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    <asp:ObjectDataSource ID="ODSCountries" runat="server" DeleteMethod="Delete" InsertMethod="Insert"
        OldValuesParameterFormatString="original_{0}" SelectMethod="GetCountryData" TypeName="IPTableAdapters.CountryTableAdapter"
        UpdateMethod="Update">
        <SelectParameters>
            <asp:SessionParameter DefaultValue="0" Name="SuperUser" SessionField="SuperUser"
                Type="String" />
        </SelectParameters>
        <DeleteParameters>
            <asp:Parameter Name="Original_Country" Type="String" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="EnglishName" Type="String" />
            <asp:Parameter Name="ChineseName" Type="String" />
            <asp:Parameter Name="UpdateBy" Type="String" />
            <asp:Parameter Name="PCTYN" Type="Boolean" />
            <asp:Parameter Name="Original_Country" Type="String" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="Country" Type="String" />
            <asp:Parameter Name="EnglishName" Type="String" />
            <asp:Parameter Name="ChineseName" Type="String" />
            <asp:Parameter Name="PCTYN" Type="Boolean" />
            <asp:Parameter Name="CreateBy" Type="String" />
            <asp:Parameter Name="UpdateBy" Type="String" />
            <asp:Parameter Name="OwnerGroupID" Type="String" />
        </InsertParameters>
    </asp:ObjectDataSource>
    <div style="margin-left:10px;margin-right:10px;">
        <asp:Panel ID="SearchPanel" runat="server">
            <fieldset>
                <legend>
                    <asp:Label ID="lblSearch" runat="server" Text="Search" meta:resourcekey="lblRoleResource1"></asp:Label></legend>
                <table>
                    <tr>
                        <td>
                            <asp:Label ID="lblSearchCountry" runat="server" Text="Country:" meta:resourcekey="lblCountryResource1"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtSearchCountry" runat="server"></asp:TextBox>&nbsp;
                        </td>
                        <td width="10"></td>
                        <td>
                            <asp:Label ID="lblSearchEnglishName" runat="server" Text="English Name:" meta:resourcekey="lblCountryEngResource1"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtSearchEnglishName" runat="server"></asp:TextBox>
                        </td>
                         <td>
                            <asp:Label ID="lblSearchChineseName" runat="server" Text="Chinese Name:" meta:resourcekey="lblCountryChiResource1"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtSearchChineseName" runat="server"></asp:TextBox>
                        </td>
                        <td width="10"></td>
                        <td colspan="2">
                            <asp:Button ID="btnSearch" runat="server" CssClass="submit" Text="Search" CausesValidation="false" meta:resourcekey="btnSearch" OnClick="btnSearch_Click" />
                            <asp:Button ID="btnNewCountry" runat="server" CausesValidation="False" CssClass="submit" Text="New Clients" meta:resourcekey="btnNewCountryResource1" OnClick="btnNewCountry_Click" />
                        </td>
                    </tr>
                </table>
            </fieldset>
        </asp:Panel>
        <table width="100%">
            <tr>
                <td align="center">
                    <asp:Label ID="lblError" runat="server" ForeColor="Red" CssClass="error" meta:resourcekey="lblErrorResource1"></asp:Label>
                </td>
            </tr>
        </table>
        <asp:Panel ID="GridPanel" runat="server" meta:resourcekey="GridPanelResource1">
            <table>
                <tr>
                    <td>
                        <asp:GridView CssClass="Grid" ID="GridView1" runat="server" AutoGenerateColumns="False"
                            BackColor="#DEBA84" BorderColor="#660000" GridLines="Both" BorderStyle="Solid"
                            BorderWidth="1px" CellPadding="0" CellSpacing="0" meta:resourcekey="GridView1Resource1" 
                            DataKeyNames="Country,EnglishName,ChineseName" DataSourceID="ODSCountries" EmptyDataText="No Country record(s) available." 
                            AllowPaging="True" PageSize="10" Width="100%"
                            OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
                            OnPageIndexChanging="GridView1_PageIndexChanging" OnRowCommand="GridView1_RowCommand"
                            OnRowDataBound="GridView1_RowDataBound">
                            <FooterStyle CssClass="GridFooterStyle" />
                            <Columns>
                                <asp:BoundField DataField="Country" HeaderText="Country" ReadOnly="True" SortExpression="Country" HeaderStyle-Width="200" meta:resourcekey="BoundFieldResource1"/>
                                <asp:BoundField DataField="EnglishName" HeaderText="English Name" SortExpression="EnglishName" HeaderStyle-Width="300" meta:resourcekey="BoundFieldResource2"/>
                                <asp:BoundField DataField="ChineseName" HeaderText="Chinese Name" SortExpression="ChineseName" HeaderStyle-Width="300" meta:resourcekey="BoundFieldResource3"/>
                                <asp:CheckBoxField DataField="PCTYN" HeaderText="PCTYN" SortExpression="PCTYN" HeaderStyle-Width="100" ItemStyle-HorizontalAlign="center" meta:resourcekey="CheckBoxFieldResource1"/>
                                <asp:BoundField DataField="CreateBy" HeaderText="CreateBy" SortExpression="CreateBy" Visible="False" meta:resourcekey="BoundFieldResource4" />
                                <asp:BoundField DataField="CreateDate" HeaderText="CreateDate" SortExpression="CreateDate" Visible="False" meta:resourcekey="BoundFieldResource5" />
                                <asp:BoundField DataField="UpdateBy" HeaderText="Update By" SortExpression="UpdateBy" HeaderStyle-Width="100" meta:resourcekey="BoundFieldResource6" />
                                <asp:BoundField DataField="UpdateDate" HeaderText="Update Date" SortExpression="UpdateDate" HeaderStyle-Width="200" meta:resourcekey="BoundFieldResource7" />
                                <asp:BoundField DataField="OwnerGroupID" HeaderText="OwnerGroupID" SortExpression="OwnerGroupID" Visible="False" meta:resourcekey="BoundFieldResource8" />
                                <asp:TemplateField HeaderText="Status" Visible="false" meta:resourcekey="ButtonFieldResourceStatus">
                                    <ItemTemplate>
                                        <asp:Label ID="lblDeleted" runat="server" Text="Deleted" Visible="false" meta:resourcekey="lblDeletedResource"></asp:Label>
                                        <asp:Label ID="lblNormal" runat="server" Text="Normal" Visible="false" meta:resourcekey="lblNormalResource"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Edit" ItemStyle-Width="60" ItemStyle-HorizontalAlign="center" meta:resourcekey="lblEditResource1">
                                    <ItemTemplate>
                                        <a href="countriesupdate.aspx?Country=<%# Eval("Country")%>"><img src="Images/icon-edit.gif" border="0" /></a>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Restore" Visible="false" meta:resourcekey="BoundFieldResourceRestore">
                                    <ItemTemplate>
                                        <asp:Label ID="lblIsDelete" runat="server" Text='<%# Eval("IsDelete") %>' Visible="false"></asp:Label>
                                        <asp:LinkButton ID="lbtnRestore" CommandName="Restore" runat="server" Text="Restore"
                                            meta:resourcekey="lbtnRestoreResource"></asp:LinkButton>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:TemplateField>
                            </Columns>
                            <RowStyle CssClass="GridRowStyle" />
                            <AlternatingRowStyle CssClass="GridRowStyle" />
                            <SelectedRowStyle CssClass="GridSelectedRowStyle" ForeColor="White" />
                            <PagerStyle CssClass="GridPagerStyle" ForeColor="White" />
                            <HeaderStyle CssClass="GridHeaderStyle" ForeColor="White" />
                        </asp:GridView>
                    </td>
                </tr>
            </table>
        </asp:Panel>
    </div>
    <div style="padding-top: 10px; display: none;">
            <fieldset style="text-align: center">
                <br />
                <table>
                    <tr>
                        <td style="vertical-align: top; width: 33%; text-align: right">
                            <asp:Label ID="lblCountry" runat="server" Text="Country" meta:resourcekey="lblCountryResource1"></asp:Label>
                        </td>
                        <td style="width: 211px; vertical-align: top; text-align: left;">
                            <asp:TextBox ID="txtCountry" runat="server" MaxLength="30" CssClass="required" meta:resourcekey="txtCountryResource1"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtCountry"
                                Display="Dynamic" ErrorMessage="Country is a required field." meta:resourcekey="RequiredFieldValidator1Resource1"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td style="vertical-align: top; width: 33%; text-align: right;">
                            <asp:Label ID="lblCountryEng" runat="server" Text="English Name" meta:resourcekey="lblCountryEngResource1"></asp:Label>
                        </td>
                        <td style="width: 211px; vertical-align: top; text-align: left;">
                            <asp:TextBox ID="txtCountryEng" runat="server" MaxLength="100" Width="331px" meta:resourcekey="txtCountryEngResource1"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="vertical-align: top; width: 33%; text-align: right">
                            <asp:Label ID="lblCountryChi" runat="server" Text="Chinese Name" meta:resourcekey="lblCountryChiResource1"></asp:Label>
                        </td>
                        <td style="width: 211px; vertical-align: top; text-align: left;">
                            <asp:TextBox ID="txtCountryChi" runat="server" MaxLength="100" Width="331px" meta:resourcekey="txtCountryChiResource1"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="vertical-align: top; width: 33%; text-align: right">
                        </td>
                        <td colspan="1" style="vertical-align: top; width: 211px; text-align: left">
                            <asp:CheckBox ID="chkPCTYN" runat="server" Text="PCT" meta:resourcekey="chkPCTYNResource1" />
                        </td>
                    </tr>
                </table>
                <table>
                    <tr>
                        <td colspan="2" style="text-align: center">
                            <div style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px; padding-top: 5px">
                                <asp:Button ID="btnNew" runat="server" CausesValidation="False" CssClass="submit"
                                    OnClick="btnNew_Click" Text="New" meta:resourcekey="btnNewResource1" />
                                <asp:Button ID="btnModify" runat="server" CausesValidation="False" CssClass="submit"
                                    OnClick="btnModify_Click" Text="Edit" meta:resourcekey="btnModifyResource1" />
                                <asp:Button ID="btnSave" runat="server" CssClass="submit" OnClick="btnSave_Click"
                                    Text="Save" meta:resourcekey="btnSaveResource1" />
                                <asp:Button ID="btnDelete" runat="server" CausesValidation="False" CssClass="submit"
                                    OnClick="btnDelete_Click" Text="Delete" meta:resourcekey="btnDeleteResource1" />
                                <asp:Button ID="btnCancel" runat="server" CssClass="reset" OnClick="btnCancel_Click"
                                    Text="Cancel" meta:resourcekey="btnCancelResource1" />
                            </div>
                        </td>
                    </tr>
                </table>
                <asp:CheckBox ID="chkForOperation" runat="server" Visible="False" meta:resourcekey="chkForOperationResource1" /><asp:CheckBox
                    ID="chkForUpdate" runat="server" Height="2px" Visible="False" Width="121px" meta:resourcekey="cbForUpdateResource1" /></fieldset>
    </div>
</asp:Content>
